public class StringTest {

    public static void main(String[] args) {
        String str = new String("abc  def");
        System.out.println("length = " + str.length());

        System.out.println(str.indexOf('d'));
        System.out.println(str.lastIndexOf('f'));
        System.out.println(str.indexOf("f"));
        System.out.println(str.lastIndexOf("a"));

    }
}
